﻿using LuShanTea.DTO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LuShanTea.IService
{
    public interface IAdminUserService : IServiceSupport
    {
        /// <summary>
        /// 添加管理员
        /// </summary>
        /// <param name="dto">参数</param>
        /// <returns></returns>
        long AddNew(AdminUserAddUpdateDto par);
        /// <summary>
        /// 修改、更新管理员信息
        /// </summary>
        /// <param name="par"></param>
        void Update(AdminUserAddUpdateDto par);
        /// <summary>
        /// 软删除管理员
        /// </summary>
        /// <param name="adminUserId"></param>
        void MarkDelete(long adminUserId);
        /// <summary>
        /// 根据电话号码查询管理员
        /// </summary>
        /// <param name="phoneNum"></param>
        /// <returns>如果不存在，返null</returns>
        AdminUserDTO GetByPhoneNum(string phoneNum);
        /// <summary>
        /// 根据Id查找管理员
        /// </summary>
        /// <param name="adminUserId"></param>
        /// <returns>如果不存在，返null</returns>
        AdminUserDTO GetById(long adminUserId);
        /// <summary>
        /// 获取所有管理员
        /// </summary>
        /// <returns></returns>
        AdminUserDTO[] GetAll();
        /// <summary>
        /// 检查登入
        /// </summary>
        /// <param name="phoneNum"></param>
        /// <param name="pwd"></param>
        /// <returns></returns>
        bool CheckLogin(string phoneNum, string pwd);
        /// <summary>
        /// 检查管理员是否有该权限
        /// </summary>
        /// <param name="adminUserId"></param>
        /// <param name="permId"></param>
        /// <returns></returns>
        bool HasPermission(long adminUserId, string permName);
        /// <summary>
        /// 修改管理员密码
        /// </summary>
        /// <param name="adminUserId"></param>
        /// <param name="newPwd"></param>
        void UpdatePwd(long adminUserId, string newPwd);
        /// <summary>
        /// 根据邮箱获取管理员
        /// </summary>
        /// <param name="email"></param>
        /// <returns></returns>
        AdminUserDTO GetByEmail(string email);
        /// <summary>
        /// 根据邮箱或者电话获取
        /// </summary>
        /// <param name="email"></param>
        /// <param name="phoneNum"></param>
        /// <returns></returns>
        AdminUserDTO GetByEmailOrPhone(string email, string phoneNum);
        /// <summary>
        /// 锁定管理员
        /// </summary>
        /// <param name="AdminUserId"></param>
        void LockAdminUser(long AdminUserId);
        /// <summary>
        /// 解除锁定
        /// </summary>
        /// <param name="AdminUserId"></param>
        void UnLockAdminUser(long AdminUserId);
        /// <summary>
        /// 判断管理员是否被锁定
        /// </summary>
        /// <param name="AdminUserId"></param>
        /// <returns></returns>
        bool IsLock(long AdminUserId);

    }
}
